package cdu.notFound.service.impl;

import cdu.notFound.Dao.CollectDao;
import cdu.notFound.Dao.impl.CollectDaoImpl;
import cdu.notFound.model.Goods;
import cdu.notFound.model.User;
import cdu.notFound.service.CollectService;
import cdu.notFound.utils.IntHolder;

import java.util.List;

public class CollectServiceImpl implements CollectService {

    CollectDao collectDao = new CollectDaoImpl();

    @Override
    public boolean doCreate(int user_id, int goods_id) {
        return collectDao.doCreate(user_id,goods_id);
    }

    @Override
    public List<Goods> findGoodsByUser(User user, IntHolder num, int limitMin, int perPage) {
        return collectDao.findGoodsByUser(user,num,limitMin,perPage);
    }

    @Override
    public boolean removeOneFromCollect(int goodsId, int userId) {
        return collectDao.removeOneFromCollect(goodsId,userId);
    }
}
